let app  =document.getElementById('app')
// app.innerHTML = 'hello word'
let requireModule = require.context(
    "../images",
    true,
    /\.png|.jpg$/
);
 
let imagesNameArr = [];
for (var i = 0; i < requireModule.keys().length; i++) {
    imagesNameArr .push(requireModule.keys()[i].substr(2, requireModule.keys()[i].length));
}
// 然后把对应的文件名和路径拼接起来：
let fragment = document.createDocumentFragment();
imagesNameArr.forEach((item)=>{
    let img = document.createElement('img')
    img.src = 'images/'+item;
    fragment.appendChild(img)
})
console.log(fragment)
app.appendChild(fragment)
console.log(imagesNameArr)